main:
  command: |
    echo "Main job running..."
  depends_on:
    - compile

compile:
  command: |
    clang ../src/main.c ../src/array.c ../src/stack.c calc.tab.c lex.yy.c -lfl -o ../bin/calc
  depends_on:
    - bison
    - flex
    - builddir
    - bindir
  src:
    ./src/*.c
  dir:
    builddir

bison:
  command: |
    bison -d ./src/gram/calc.y -o ./builddir/calc.tab.c
  depends_on:
    - builddir
  src:
    - ./src/gram/calc.y

flex:
  command: |
    cp ../src/gram/calc.l .
    flex calc.l
  depends_on:
    - bison
    - builddir
  src:
    ./src/gram/calc.l
  dir:
    builddir

builddir:
  command: |
    mkdir -p builddir

clean:
  command: |
    rm -rf builddir
    neph clean

bindir:
  command: |
    mkdir -p bin
